package com.ddx.common.enums;


public enum AppPlatformType {

    ANDROID(0,"android"),
    IOS(1,"ios");
    
    private Integer code;
    private String description;

    AppPlatformType(Integer code, String description ) {
        this.code = code;
        this.description  = description ;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static AppPlatformType getAppPlatformType(Integer code) {
        for (AppPlatformType t : AppPlatformType.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
    public static AppPlatformType getAppPlatformType(String description) {
        for (AppPlatformType t : AppPlatformType.values()) {
            if (description .equalsIgnoreCase(t.getDescription())) {
                return t;
            }
        }
        return null;
    }
    
    
}
